<?php
require_once "rest-request.php";

class RestRequestFactory {
	private $requests;

	function __construct() {
		$this->requests = array();
		$this->requests["GET"] = new RestGetRequest();
		$this->requests["POST"] = new RestPostRequest();
		$this->requests["PUT"] = new RestPutRequest();
		$this->requests["DELETE"] = new RestDeleteRequest();
	}
	
	function CreateRequest($type) {
		if(array_key_exists($type, $this->requests)) {
			return clone $this->requests[$type];
		} else {
			// TODO - throw exception
		}
	}
}

?>